Skip to content

Notebook: fold unchanged rows on reopen (PR 17b-2) - #248

Merged
guijacquemet merged 6 commits into
mainfrom
claude/notebook-17b-2
Nov 9, 2026
Merged

guijacquemet merged 6 commits into
mainfrom
claude/notebook-17b-2

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

This is the second half of PR 17b, item 1 of the owner's 17b scope ("fold unchanged rows on reopen", already decided in docs/restart/designs/ux-proposal-2026-11-09.md). It is stacked on #247 (17b-1) and its base is claude/notebook-17b, so the diff is only 17b-2. Merge #247 first; GitHub then retargets this PR to main.

Summary

  • notebook_row_fold (new, ui):
    • reopen_units(reconciliation) gives the status of each unit against the saved file. A unit is unchanged when it is found as saved, changed when its member's image count changed, and new when the file does not have it. Units are matched by their exact folder labels (the existing reconcile).
    • row_status(units, keys, answered) says what a row does: it folds only when every unit it holds is unchanged and its question is answered. A row with a new or unknown unit counts as new. Without a saved file nothing folds.
    • RowFold puts the folded rows behind one line ("✓ 3 unchanged folders, answered as saved") with an open/close toggle, which stays open across rebuilds. New and changed rows stay open, in their order, with an orange border and the chip "new since saved" or "changed since saved".
  • Where rows fold on a reopened experiment (PreprocessingNotebook._reopen_units in notebook_described):
    • the pairing rows (Replicates);
    • the names, by kind: conditions, replicates and technical-repeat folders, each folded once its ID is confirmed;
    • the image-type rows, once answered;
    • the tag blocks, once every channel and type is answered;
    • the Check and save replicate blocks, once "same way?" is answered.
  • It is display only. A folded row keeps its widgets and answers, and opening it shows them unchanged. Answers, draft, save and run are untouched. "Yes, remove" is still not persisted (already decided).

Notes for review

  • Size: 12 files, +359/−20.
  • An unchanged reopen folds every answered row as well, on top of the existing whole-screen fold on Check and save.
  • Not verified in a live JupyterLab or Colab. The pages were rendered with embed_minimal_html in Playwright chromium (1180 px, deviceScaleFactor 2).

Tests

  • New tests/test_notebook_row_fold.py (4 tests):
    • the status rules: unchanged, new, count changed, unanswered, unknown, no file;
    • a changed reopen (three folders saved, then drug/rep2 added) folds the unchanged tag block, the 3 image types, the ctrl condition, rep1 and its replicate block, and marks the new ones;
    • opening a fold shows the rows, keeps them open across a rebuild and changes no answer;
    • nothing folds without a saved file.
  • python tools/check.py on the head commit (Python 3.13, .[dev,notebook,zarr]): ruff, format and code rules pass; 4975 passed, 4 skipped. These are the same environment skips as Notebook: tags per header block, colour pictures, one-click axes (PR 17b-1) #247: a case-sensitive file system ×3, and running as root, which ignores file modes, ×1.
  • Screenshots 27-33: an unchanged reopen, and a mixed reopen with ctrl/rep3 and drug/rep3 added. They show Conditions, Replicates (pairing and names), Image type, Tag channels (folded, then opened) and Check and save. Each one was looked at; the fold line's plural ("1 unchanged folder block") was fixed after looking.

🤖 Generated with Claude Code

https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc

On a reopened experiment, a row whose folders are found exactly as saved
and whose question is answered folds behind one line with an open toggle
(pairing, names, image types, tag blocks, Check and save replicates). New
or changed rows stay open and are marked orange. Display only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
- reopen_units ignored the reconciliation's reasons, so a folder whose header channel names
  no longer fit the saved channels (channels_changed), or a renamed folder, folded as
  "unchanged". Such a unit is now "changed" and stays open, in orange.
- An image-type row folded once answered, hiding the warning under its choice (a type the
  header contradicts, which the run refuses) and an unusable folder's note; it now folds only
  when answered, usable and with no warning (ImageTypeColumn.note is public for this).
- A Check-and-save replicate block folded with its orange A_SCOPE_INCOMPLETE line; a block
  with a missing label now stays open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
Base automatically changed from claude/notebook-17b to main November 9, 2026 10:18
@guijacquemet
guijacquemet merged commit 45241f1 into main Nov 9, 2026
7 checks passed
@guijacquemet
guijacquemet deleted the claude/notebook-17b-2 branch November 9, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants